package com.andova.cameraview;

import androidx.annotation.Nullable;

import java.util.List;

/**
 * Callback for monitoring events about {@link CameraView}.
 */
@SuppressWarnings("UnusedParameters")
public abstract class CameraCallback {
    /**
     * Called when camera is opened.
     *
     * @param cameraView The associated {@link CameraView}.
     */
    public void onOpened(CameraView cameraView) {
    }

    /**
     * Called when camera is closed.
     *
     * @param cameraView The associated {@link CameraView}.
     */
    public void onClosed(CameraView cameraView) {
    }

    /**
     * Called when camera is disconnected.
     *
     * @param cameraView The associated {@link CameraView}.
     */
    public void onDisconnected(CameraView cameraView) {
    }

    /**
     * Called when camera is exception.
     */
    public void onError(int error, @Nullable Throwable t) {
    }

    /**
     * Called when a picture is taken.
     *
     * @param cameraView The associated {@link CameraView}.
     * @param data       JPEG data.
     */
    public void onPictTaken(CameraView cameraView, @Nullable byte[] data) {
    }

    public void onPrevFrame(CameraView cameraView, @Nullable byte[] data) {
    }

    @Nullable
    public Size onPrevSize(List<Size> sizes) {
        return null;
    }

    @Nullable
    public Size onPictSize(List<Size> sizes) {
        return null;
    }
}